from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import pandas as pd
import numpy as np
import datetime


class RequestHandler(BaseHTTPRequestHandler):
    def _send_response(self, status_code, data):
        self.send_response(status_code)
        self.send_header('Content-type', 'application/json')
        self.end_headers()
        self.wfile.write(json.dumps(data).encode())

    def do_GET(self):
        if self.path == '/api/status':
            response_data = {"status": "running", "version": "1.0"}
            self._send_response(200, response_data)

        elif self.path == '/api/stats':
            response_data = {"total_requests": 100, "active_users": 50}
            self._send_response(200, response_data)

        else:
            self._send_response(404, {"error": "Not found"})

    def do_POST(self):
        content_length = int(self.headers['Content-Length'])
        post_data = self.rfile.read(content_length)
        data = json.loads(post_data)

        if self.path == '/api/risk_level':
            # 接口1：风险等级计算
            # 假设data是一个DataFrame的字典形式
            # 这里需要将字典转换为DataFrame
            # 示例：
            # data = {
            #     "id": [1, 2, 3],
            #     "diameter": [100, 200, 300],
            #     "material": ["steel", "cast_iron", "plastic"],
            #     "pressure": [10, 20, 30]
            # }
            df = pd.DataFrame(data, columns=["id", "diameter", "material", "pressure"])
            result = risk_level(df)
            result_json = result.to_json(orient='records')
            response_data = {"risk_level": result_json}
            self._send_response(200, response_data)

        elif self.path == '/api/age_based_risk':
            # 接口2：基于年龄的风险评估
            # 假设data是一个DataFrame的字典形式
            # 示例：
            # data = {
            #     "id": [1, 2, 3],
            #     "material": ["steel", "cast_iron", "plastic"],
            #     "installation_year": [2000, 2005, 2010],
            #     "pressure_score": [0.8, 0.7, 0.6]
            # }
            df = pd.DataFrame(data, columns=["id", "material", "installation_year", "pressure_score"])
            current_year = datetime.datetime.now().year
            result = age_based_risk(df, current_year=current_year)
            result_json = result.to_json(orient='records')
            response_data = {"age_based_risk": result_json}
            self._send_response(200, response_data)

        elif self.path == '/api/smart_pressure_control':
            # 接口3：智能调压
            # 假设data是一个DataFrame的字典形式
            # 示例：
            # data = {
            #     "time": ["2023-01-01 00:00", "2023-01-01 01:00"],
            #     "pressure": [10, 20]
            # }
            df = pd.DataFrame(data, columns=["time", "id", "pressure"])
            # Convert time to datetime if it's not already
            if not isinstance(df['time'], pd.DatetimeIndex):
                df['time'] = pd.to_datetime(df['time'])
            # Apply smart pressure control
            result = smart_pressure_control(df)
            # Convert DataFrame back to JSON
            result_json = result.to_json(orient='records')
            response_data = {"smart_pressure_control": result_json}
            # Send response
            self._send_response(200, response_data)

        elif self.path == '/api/detect_pipe_burst':
            # 接口4：爆管预测
            # 假设data是一个DataFrame的字典形式
            # 示例：
            # data = {
            #     "time": ["2023-01-01 00:00", "2023-01-01 01:00"],
            #     "pressure": [10, 20],
            #     "flow": [100, 200],
            #     "demand": [50, 60]
            # }
            df = pd.DataFrame(data, columns=["time", "pressure", "flow", "demand"])
            # Convert time to datetime if it's not already
            if not isinstance(df['time'], pd.DatetimeIndex):
                df['time'] = pd.to_datetime(df['time'])
            # Apply detect pipe burst
            result = detect_pipe_burst(df)
            # Convert DataFrame back to JSON
            result_json = result.to_json(orient='records')
            response_data = {"detect_pipe_burst": result_json}
            self._send_response(200, response_data)

        elif self.path == '/api/detect_pressure_anomaly':
            # 接口5：压力瞬变报警
            # 假设data是一个DataFrame的字典形式
            # 示例：
            # data = {
            #     "time": ["2023-01-01 00:00", "2023-01-01 01:00"],
            #     "pressure": [10, 20]
            # }
            df = pd.DataFrame(data, columns=["time", "pressure"])
            # Convert time to datetime if it's not already
            if not isinstance(df['time'], pd.DatetimeIndex):
                df['time'] = pd.to_datetime(df['time'])
            # Apply detect pressure anomaly
            result = detect_pressure_anomaly(df)
            # Convert DataFrame back to JSON
            result_json = result.to_json(orient='records')
            response_data = {"pressure_anomaly": result_json}
            self._send_response(200, response_data)

        else:
            self._send_response(404, {"error": "Not found"})


def run_server(port=8000):
    # Create an HTTP server and define the handler to manage requests
    server_address = ('', port)
    httpd = HTTPServer(server_address, RequestHandler)
    print(f"Starting server on port {port}...")
    httpd.serve_forever()


# 接口1 - 风险等级计算
# 输入值应该为一个管道列表，每个管道包含四个属性：编号、直径、材料和压力
# 输出值应该为一个管道列表，每个管道包含五个属性：编号、直径、材料、压力和风险等级
# 后续优化点为继续增加每一行的参数数量

def risk_level(df):
    # Weights for each factor
    w_diameter = 0.3
    w_material = 0.3
    w_pressure = 0.4

    # Calculate mean diameter for reference
    DN_mean = df['diameter'].mean()

    # Diameter score using sigmoid function
    df['diameter_score'] = 2 / (1 + np.exp(-np.log(DN_mean / df['diameter'])))

    # Material score mapping
    material_scores = {
        'steel': 1.0,
        'cast_iron': 0.9,
        'concrete': 0.8,
        'plastic': 0.7
    }
    df['material_score'] = df['material'].map(material_scores)

    # Pressure score using sigmoid function
    P_mean = df['pressure'].mean()
    df['pressure_score'] = 2 / (1 + np.exp(-np.log(df['pressure'] / P_mean)))

    # Calculate total risk score
    df['risk_score'] = (w_diameter * df['diameter_score'] +
                        w_material * df['material_score'] +
                        w_pressure * df['pressure_score'])

    # Assign risk levels based on percentiles
    df['risk_level'] = 'low'
    df.loc[df['risk_score'] >= df['risk_score'].quantile(0.65), 'risk_level'] = 'medium'
    df.loc[df['risk_score'] >= df['risk_score'].quantile(0.85), 'risk_level'] = 'high'

    return df


# 接口2：基于年龄的风险评估
# 输入：
# - df: 包含以下列的数据框
#   - id: 管道ID，字符串
#   - material: 管道材质，字符串，取值范围为{'cast_iron', 'ductile_iron', 'steel', 'concrete', 'PVC', 'PE'}
#   - installation_year: 管道安装年份，整数
#   - pressure_score: 管道压力评分，浮点数，压力评分可以由risk_level接口计算得到
# 输出：
# - df: 原始数据框df，新增以下列
#   - age: 管道年龄
#   - pressure_coef: 压力系数，根据压力评分计算
#   - effective_age: 等效年龄，考虑压力影响
#   - age_risk: 基于年龄的漏损风险率
#   - predicted_risk_1y: 下一年的风险预测
#   - predicted_risk_2y: 两年后的风险预测
#   - predicted_risk_3y: 三年后的风险预测
#   - predicted_risk_4y: 四年后的风险预测
#   - predicted_risk_5y: 五年后的风险预测
#   - predicted_risk_6y: 六年后的风险预测
#   - predicted_risk_7y: 七年后的风险预测
#   - predicted_risk_8y: 八年后的风险预测
#   - predicted_risk_9y: 九年后的风险预测
#   - predicted_risk_10y: 十年后的风险预测
#   - years_until_critical: 预计几年后风险超过0.8

def age_based_risk(df, current_year):
    # Define material life expectancy (in years)
    material_life = {
        'cast_iron': 30,  # average of 25-35 for grey cast iron
        'ductile_iron': 50,
        'steel': 20,  # average of 15-25 for galvanized steel
        'concrete': 30,
        'PVC': 45,
        'PE': 60
    }

    # Add current age column (example: assuming current year is 2023 and installation_year exists)
    # If installation_year doesn't exist, you'll need to add it to your data
    df['age'] = current_year - df['installation_year']

    # Calculate pressure coefficient (0.8-1.2 range based on pressure score)
    df['pressure_coef'] = 0.8 + 0.4 * df['pressure_score']

    # Calculate effective age (considering pressure influence)
    df['effective_age'] = df['age'] * df['pressure_coef']

    # Calculate risk based on age
    def calculate_age_risk(row):
        base_life = material_life.get(row['material'], 30)  # default 30 if material not found
        threshold = base_life * 0.7  # 70% of expected life as threshold
        x = row['effective_age'] / threshold
        return 1 / (1 + np.exp(-4 * np.log(x))) if x > 0 else 0

    df['age_risk'] = df.apply(calculate_age_risk, axis=1)

    # Calculate predicted risk for next 10 years
    future_risks = []
    for i in range(1, 11):
        df[f'predicted_risk_{i}y'] = df.apply(
            lambda row: calculate_age_risk({
                'material': row['material'],
                'effective_age': row['effective_age'] + i * row['pressure_coef']
            }),
            axis=1
        )

    # Calculate critical year (when risk exceeds 0.8)
    def find_critical_year(row):
        age = row['effective_age']
        base_life = material_life.get(row['material'], 30)
        year = 0
        while year < 50:  # limit to 50 years in future
            risk = calculate_age_risk({
                'material': row['material'],
                'effective_age': age + year * row['pressure_coef']
            })
            if risk > 0.8:
                return year
            year += 1
        return None

    df['years_until_critical'] = df.apply(find_critical_year, axis=1)

    return df


# 接口3 - 智能调压
# 输入值应该为一个监测数据列表，每个监测数据包含时间和压力
# 输出值应该为一个监测数据列表，每个监测数据包含时间和压力

def smart_pressure_control(df, time_column=None):
    # Make a copy to avoid modifying the original dataframe
    df = df.copy()
    df['time'] = pd.to_datetime(df['time'])
    # Extract hour from datetime
    df['hour'] = df['time'].dt.hour

    # Define time periods and their pressure reduction factors
    def get_reduction_factor(hour):
        if hour in range(7, 10) or hour in range(10, 14) or hour in range(17, 23):
            return 1.0  # No reduction in peak hours
        elif hour in range(0, 6):
            return 0.7  # 30% reduction in early morning
        else:
            return 0.85  # 15% reduction in other periods

    # Apply pressure adjustments
    df['reduction_factor'] = df['hour'].apply(get_reduction_factor)
    df['adjusted_pressure'] = df['pressure'] * df['reduction_factor']

    # Ensure minimum pressure of 0.25 MPa
    df['adjusted_pressure'] = df['adjusted_pressure'].clip(lower=0.25)

    # Clean up temporary columns
    df = df.drop(['hour', 'reduction_factor'], axis=1)

    return df


# 接口4 - 爆管预测
# 输入值应该为一个监测数据列表，每个监测数据包含五个属性：时间、压力、流量、需水量
# 输出值应该为一个监测数据列表，每个监测数据包含九个属性：时间、压力、流量、需水量、压力差、流量差、压力变化率、流量变化率和是否爆管

def detect_pipe_burst(df_monitor, pressure_threshold=0.05, flow_threshold=0.10, closed_flow_threshold=0.10):
    # Calculate pressure and flow differences
    df_monitor['pressure_diff'] = df_monitor['pressure'].diff()
    df_monitor['flow_diff'] = df_monitor['flow'].diff()

    # Calculate percentage changes
    df_monitor['pressure_change_pct'] = (df_monitor['pressure_diff'] / df_monitor['pressure'].shift(1)).abs()
    df_monitor['flow_change_pct'] = (df_monitor['flow_diff'] / df_monitor['flow'].shift(1)).abs()

    # Determine if segment is closed (no demand)
    df_monitor['is_closed'] = df_monitor['demand'] == 0

    # Initialize burst detection columns
    df_monitor['burst_detected'] = False
    df_monitor['burst_type'] = None

    # Detect bursts for closed segments
    closed_burst = (
            df_monitor['is_closed'] &
            (df_monitor['flow_change_pct'] > closed_flow_threshold)
    )

    # Detect bursts for open segments
    open_burst = (
            ~df_monitor['is_closed'] &
            (df_monitor['pressure_change_pct'] > pressure_threshold) &
            (df_monitor['flow_change_pct'] > flow_threshold) &
            (df_monitor['pressure_diff'] < 0) &  # Pressure must decrease
            (df_monitor['flow_diff'] > 0)  # Flow must increase
    )

    # Set burst detection results
    df_monitor.loc[closed_burst, 'burst_detected'] = True
    df_monitor.loc[closed_burst, 'burst_type'] = 'closed_segment'
    df_monitor.loc[open_burst, 'burst_detected'] = True
    df_monitor.loc[open_burst, 'burst_type'] = 'pressure_flow'

    return df_monitor


# 接口5：压力瞬变报警
# 输入：
# - df_monitor: 包含以下列的数据框
#   - time: 时间戳
#   - pressure: 压力值
# 输出：
# - df_monitor: 原始数据框df_monitor，新增以下列
#   - time_block: 时间块，0-47之间的整数，表示一天中的48个半小时
#   - pressure_baseline: 时间块的压力基线
#   - pressure_deviation: 压力偏差
#   - anomaly_detected: 是否检测到异常

def detect_pressure_anomaly(df_monitor, threshold=0.20, window_days=30):
    # Convert time to datetime if it's not already
    df_monitor['time'] = pd.to_datetime(df_monitor['time'])

    # Create time block (0-47 for 48 half-hour periods in a day)
    df_monitor['time_block'] = (df_monitor['time'].dt.hour * 2 +
                                (df_monitor['time'].dt.minute >= 30).astype(int))

    # Calculate baseline pressures for each time block
    historical_data = df_monitor[
        df_monitor['time'] >= df_monitor['time'].max() - pd.Timedelta(days=window_days)
        ]

    pressure_baselines = historical_data.groupby('time_block')['pressure'].mean()

    # Add baseline pressures to main dataframe
    df_monitor['pressure_baseline'] = df_monitor['time_block'].map(pressure_baselines)

    # Calculate deviation from baseline
    df_monitor['pressure_deviation'] = ((df_monitor['pressure'] - df_monitor['pressure_baseline']) /
                                        df_monitor['pressure_baseline']).abs()

    # Detect anomalies
    df_monitor['anomaly_detected'] = df_monitor['pressure_deviation'] > threshold

    return df_monitor


if __name__ == '__main__':
    run_server()

# 接口1示例：[{"id": 1, "diameter": 150, "material": "steel", "pressure": 0.3}, {"id": 2, "diameter": 200, "material": "cast_iron", "pressure": 0.2}, {"id": 3, "diameter": 150, "material": "concrete", "pressure": 0.3}, {"id": 4, "diameter": 150, "material": "plastic", "pressure": 0.15}, {"id": 5, "diameter": 100, "material": "steel", "pressure": 0.4}, {"id": 6, "diameter": 200, "material": "cast_iron", "pressure": 0.35}, {"id": 7, "diameter": 500, "material": "concrete", "pressure": 0.45}, {"id": 8, "diameter": 300, "material": "plastic", "pressure": 0.22}, {"id": 9, "diameter": 200, "material": "steel", "pressure": 0.42}, {"id": 10, "diameter": 150, "material": "cast_iron", "pressure": 0.32}, {"id": 11, "diameter": 100, "material": "concrete", "pressure": 0.35}, {"id": 12, "diameter": 100, "material": "plastic", "pressure": 0.33}, {"id": 13, "diameter": 200, "material": "steel", "pressure": 0.37}, {"id": 14, "diameter": 450, "material": "cast_iron", "pressure": 0.5}, {"id": 15, "diameter": 500, "material": "concrete", "pressure": 0.1}, {"id": 16, "diameter": 300, "material": "plastic", "pressure": 0.15}, {"id": 17, "diameter": 250, "material": "steel", "pressure": 0.32}, {"id": 18, "diameter": 300, "material": "cast_iron", "pressure": 0.34}, {"id": 19, "diameter": 100, "material": "concrete", "pressure": 0.43}, {"id": 20, "diameter": 150, "material": "plastic", "pressure": 0.35}, {"id": 21, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 22, "diameter": 200, "material": "plastic", "pressure": 0.2}, {"id": 23, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 24, "diameter": 150, "material": "plastic", "pressure": 0.15}, {"id": 25, "diameter": 100, "material": "plastic", "pressure": 0.4}, {"id": 26, "diameter": 200, "material": "plastic", "pressure": 0.35}, {"id": 27, "diameter": 500, "material": "plastic", "pressure": 0.45}, {"id": 28, "diameter": 300, "material": "plastic", "pressure": 0.22}, {"id": 29, "diameter": 200, "material": "plastic", "pressure": 0.42}, {"id": 30, "diameter": 150, "material": "plastic", "pressure": 0.32}, {"id": 31, "diameter": 100, "material": "plastic", "pressure": 0.35}, {"id": 32, "diameter": 100, "material": "plastic", "pressure": 0.33}, {"id": 33, "diameter": 200, "material": "plastic", "pressure": 0.37}, {"id": 34, "diameter": 450, "material": "plastic", "pressure": 0.5}, {"id": 35, "diameter": 500, "material": "plastic", "pressure": 0.1}, {"id": 36, "diameter": 300, "material": "plastic", "pressure": 0.15}, {"id": 37, "diameter": 250, "material": "plastic", "pressure": 0.32}, {"id": 38, "diameter": 300, "material": "plastic", "pressure": 0.34}, {"id": 39, "diameter": 100, "material": "plastic", "pressure": 0.43}, {"id": 40, "diameter": 150, "material": "plastic", "pressure": 0.35}, {"id": 41, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 42, "diameter": 200, "material": "plastic", "pressure": 0.2}, {"id": 43, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 44, "diameter": 150, "material": "plastic", "pressure": 0.15}, {"id": 45, "diameter": 100, "material": "plastic", "pressure": 0.4}, {"id": 46, "diameter": 200, "material": "plastic", "pressure": 0.35}, {"id": 47, "diameter": 500, "material": "plastic", "pressure": 0.45}, {"id": 48, "diameter": 300, "material": "plastic", "pressure": 0.22}, {"id": 49, "diameter": 200, "material": "plastic", "pressure": 0.42}, {"id": 50, "diameter": 150, "material": "plastic", "pressure": 0.32}, {"id": 51, "diameter": 100, "material": "plastic", "pressure": 0.35}, {"id": 52, "diameter": 100, "material": "plastic", "pressure": 0.33}, {"id": 53, "diameter": 200, "material": "plastic", "pressure": 0.37}, {"id": 54, "diameter": 450, "material": "plastic", "pressure": 0.5}, {"id": 55, "diameter": 500, "material": "plastic", "pressure": 0.1}, {"id": 56, "diameter": 300, "material": "plastic", "pressure": 0.15}, {"id": 57, "diameter": 250, "material": "plastic", "pressure": 0.32}, {"id": 58, "diameter": 300, "material": "plastic", "pressure": 0.34}, {"id": 59, "diameter": 100, "material": "plastic", "pressure": 0.43}, {"id": 60, "diameter": 150, "material": "plastic", "pressure": 0.35}, {"id": 61, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 62, "diameter": 200, "material": "plastic", "pressure": 0.2}, {"id": 63, "diameter": 150, "material": "plastic", "pressure": 0.3}, {"id": 64, "diameter": 150, "material": "plastic", "pressure": 0.15}, {"id": 65, "diameter": 100, "material": "plastic", "pressure": 0.4}, {"id": 66, "diameter": 200, "material": "plastic", "pressure": 0.35}, {"id": 67, "diameter": 500, "material": "plastic", "pressure": 0.45}, {"id": 68, "diameter": 300, "material": "plastic", "pressure": 0.22}, {"id": 69, "diameter": 200, "material": "plastic", "pressure": 0.42}, {"id": 70, "diameter": 150, "material": "plastic", "pressure": 0.32}, {"id": 71, "diameter": 100, "material": "plastic", "pressure": 0.35}, {"id": 72, "diameter": 100, "material": "plastic", "pressure": 0.33}, {"id": 73, "diameter": 200, "material": "plastic", "pressure": 0.37}, {"id": 74, "diameter": 450, "material": "plastic", "pressure": 0.5}, {"id": 75, "diameter": 500, "material": "plastic", "pressure": 0.1}, {"id": 76, "diameter": 300, "material": "plastic", "pressure": 0.15}, {"id": 77, "diameter": 250, "material": "plastic", "pressure": 0.32}, {"id": 78, "diameter": 300, "material": "plastic", "pressure": 0.34}, {"id": 79, "diameter": 100, "material": "plastic", "pressure": 0.43}, {"id": 80, "diameter": 150, "material": "plastic", "pressure": 0.35}, {"id": 81, "diameter": 150, "material": "steel", "pressure": 0.3}, {"id": 82, "diameter": 200, "material": "steel", "pressure": 0.2}, {"id": 83, "diameter": 150, "material": "steel", "pressure": 0.3}, {"id": 84, "diameter": 150, "material": "steel", "pressure": 0.15}, {"id": 85, "diameter": 100, "material": "steel", "pressure": 0.4}, {"id": 86, "diameter": 200, "material": "steel", "pressure": 0.35}, {"id": 87, "diameter": 500, "material": "steel", "pressure": 0.45}, {"id": 88, "diameter": 300, "material": "steel", "pressure": 0.22}, {"id": 89, "diameter": 200, "material": "steel", "pressure": 0.42}, {"id": 90, "diameter": 150, "material": "steel", "pressure": 0.32}, {"id": 91, "diameter": 100, "material": "cast_iron", "pressure": 0.35}, {"id": 92, "diameter": 100, "material": "cast_iron", "pressure": 0.33}, {"id": 93, "diameter": 200, "material": "cast_iron", "pressure": 0.37}, {"id": 94, "diameter": 450, "material": "cast_iron", "pressure": 0.5}, {"id": 95, "diameter": 500, "material": "cast_iron", "pressure": 0.1}, {"id": 96, "diameter": 300, "material": "cast_iron", "pressure": 0.15}, {"id": 97, "diameter": 250, "material": "cast_iron", "pressure": 0.32}, {"id": 98, "diameter": 300, "material": "cast_iron", "pressure": 0.34}, {"id": 99, "diameter": 100, "material": "cast_iron", "pressure": 0.43}, {"id": 100, "diameter": 150, "material": "cast_iron", "pressure": 0.35}]
# 接口2示例：[{"id": 1, "material": "cast_iron", "installation_year": 2010, "pressure_score": 1.162786924}, {"id": 2, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 1.162786924}, {"id": 3, "material": "steel", "installation_year": 2022, "pressure_score": 1.146994562}, {"id": 4, "material": "concrete", "installation_year": 2023, "pressure_score": 1.116994562}, {"id": 5, "material": "PVC", "installation_year": 2022, "pressure_score": 1.106269549}, {"id": 6, "material": "PE", "installation_year": 2020, "pressure_score": 1.094515901}, {"id": 7, "material": "cast_iron", "installation_year": 2011, "pressure_score": 1.086994562}, {"id": 8, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 1.086994562}, {"id": 9, "material": "steel", "installation_year": 2004, "pressure_score": 1.086994562}, {"id": 10, "material": "concrete", "installation_year": 1999, "pressure_score": 1.076269549}, {"id": 11, "material": "PVC", "installation_year": 2012, "pressure_score": 1.074891466}, {"id": 12, "material": "PE", "installation_year": 2011, "pressure_score": 1.074891466}, {"id": 13, "material": "cast_iron", "installation_year": 2010, "pressure_score": 1.072786924}, {"id": 14, "material": "ductile_iron", "installation_year": 2022, "pressure_score": 1.072786924}, {"id": 15, "material": "steel", "installation_year": 2023, "pressure_score": 1.072786924}, {"id": 16, "material": "concrete", "installation_year": 2023, "pressure_score": 1.063158031}, {"id": 17, "material": "PVC", "installation_year": 2022, "pressure_score": 1.051065059}, {"id": 18, "material": "PE", "installation_year": 2016, "pressure_score": 1.050253372}, {"id": 19, "material": "cast_iron", "installation_year": 2018, "pressure_score": 1.050253372}, {"id": 20, "material": "ductile_iron", "installation_year": 2017, "pressure_score": 1.050253372}, {"id": 21, "material": "steel", "installation_year": 2010, "pressure_score": 1.0498437}, {"id": 22, "material": "concrete", "installation_year": 2013, "pressure_score": 1.046269549}, {"id": 23, "material": "PVC", "installation_year": 2022, "pressure_score": 1.046269549}, {"id": 24, "material": "PE", "installation_year": 2023, "pressure_score": 1.046269549}, {"id": 25, "material": "cast_iron", "installation_year": 2022, "pressure_score": 1.038773901}, {"id": 26, "material": "ductile_iron", "installation_year": 2020, "pressure_score": 1.034515901}, {"id": 27, "material": "steel", "installation_year": 2011, "pressure_score": 1.034515901}, {"id": 28, "material": "concrete", "installation_year": 2007, "pressure_score": 1.034515901}, {"id": 29, "material": "PVC", "installation_year": 2004, "pressure_score": 1.034515901}, {"id": 30, "material": "PE", "installation_year": 1999, "pressure_score": 1.033158031}, {"id": 31, "material": "cast_iron", "installation_year": 2012, "pressure_score": 1.0198437}, {"id": 32, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 1.008773901}, {"id": 33, "material": "steel", "installation_year": 2010, "pressure_score": 0.991065059}, {"id": 34, "material": "concrete", "installation_year": 2022, "pressure_score": 0.991065059}, {"id": 35, "material": "PVC", "installation_year": 2023, "pressure_score": 0.991065059}, {"id": 36, "material": "PE", "installation_year": 2023, "pressure_score": 0.991065059}, {"id": 37, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.990253372}, {"id": 38, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.987432502}, {"id": 39, "material": "steel", "installation_year": 2018, "pressure_score": 0.984891466}, {"id": 40, "material": "concrete", "installation_year": 2017, "pressure_score": 0.984891466}, {"id": 41, "material": "PVC", "installation_year": 2010, "pressure_score": 0.984891466}, {"id": 42, "material": "PE", "installation_year": 2013, "pressure_score": 0.973158031}, {"id": 43, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.973158031}, {"id": 44, "material": "ductile_iron", "installation_year": 2023, "pressure_score": 0.973158031}, {"id": 45, "material": "steel", "installation_year": 2022, "pressure_score": 0.960772651}, {"id": 46, "material": "concrete", "installation_year": 2020, "pressure_score": 0.960772651}, {"id": 47, "material": "PVC", "installation_year": 2011, "pressure_score": 0.960253372}, {"id": 48, "material": "PE", "installation_year": 2007, "pressure_score": 0.960253372}, {"id": 49, "material": "cast_iron", "installation_year": 2004, "pressure_score": 0.960253372}, {"id": 50, "material": "ductile_iron", "installation_year": 1999, "pressure_score": 0.960253372}, {"id": 51, "material": "steel", "installation_year": 2012, "pressure_score": 0.960253372}, {"id": 52, "material": "concrete", "installation_year": 2011, "pressure_score": 0.960253372}, {"id": 53, "material": "PVC", "installation_year": 2010, "pressure_score": 0.9598437}, {"id": 54, "material": "PE", "installation_year": 2022, "pressure_score": 0.9598437}, {"id": 55, "material": "cast_iron", "installation_year": 2023, "pressure_score": 0.9598437}, {"id": 56, "material": "ductile_iron", "installation_year": 2023, "pressure_score": 0.957432502}, {"id": 57, "material": "steel", "installation_year": 2022, "pressure_score": 0.956684241}, {"id": 58, "material": "concrete", "installation_year": 2016, "pressure_score": 0.948773901}, {"id": 59, "material": "PVC", "installation_year": 2018, "pressure_score": 0.948773901}, {"id": 60, "material": "PE", "installation_year": 2017, "pressure_score": 0.948773901}, {"id": 61, "material": "cast_iron", "installation_year": 2010, "pressure_score": 0.942455985}, {"id": 62, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 0.942455985}, {"id": 63, "material": "steel", "installation_year": 2022, "pressure_score": 0.92847699}, {"id": 64, "material": "concrete", "installation_year": 2023, "pressure_score": 0.918273896}, {"id": 65, "material": "PVC", "installation_year": 2022, "pressure_score": 0.900772651}, {"id": 66, "material": "PE", "installation_year": 2020, "pressure_score": 0.900772651}, {"id": 67, "material": "cast_iron", "installation_year": 2011, "pressure_score": 0.900772651}, {"id": 68, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 0.89847699}, {"id": 69, "material": "steel", "installation_year": 2004, "pressure_score": 0.897432502}, {"id": 70, "material": "concrete", "installation_year": 1999, "pressure_score": 0.897432502}, {"id": 71, "material": "PVC", "installation_year": 2012, "pressure_score": 0.897432502}, {"id": 72, "material": "PE", "installation_year": 2011, "pressure_score": 0.896684241}, {"id": 73, "material": "cast_iron", "installation_year": 2010, "pressure_score": 0.886209633}, {"id": 74, "material": "ductile_iron", "installation_year": 2022, "pressure_score": 0.882455985}, {"id": 75, "material": "steel", "installation_year": 2023, "pressure_score": 0.882455985}, {"id": 76, "material": "concrete", "installation_year": 2023, "pressure_score": 0.882455985}, {"id": 77, "material": "PVC", "installation_year": 2022, "pressure_score": 0.866684241}, {"id": 78, "material": "PE", "installation_year": 2016, "pressure_score": 0.866684241}, {"id": 79, "material": "cast_iron", "installation_year": 2018, "pressure_score": 0.866684241}, {"id": 80, "material": "ductile_iron", "installation_year": 2017, "pressure_score": 0.83847699}, {"id": 81, "material": "steel", "installation_year": 2010, "pressure_score": 0.83847699}, {"id": 82, "material": "concrete", "installation_year": 2013, "pressure_score": 0.83847699}, {"id": 83, "material": "PVC", "installation_year": 2022, "pressure_score": 0.828273896}, {"id": 84, "material": "PE", "installation_year": 2023, "pressure_score": 0.828273896}, {"id": 85, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.828273896}, {"id": 86, "material": "ductile_iron", "installation_year": 2020, "pressure_score": 0.828273896}, {"id": 87, "material": "steel", "installation_year": 2011, "pressure_score": 0.796209633}, {"id": 88, "material": "concrete", "installation_year": 2007, "pressure_score": 0.796209633}, {"id": 89, "material": "PVC", "installation_year": 2004, "pressure_score": 0.796209633}, {"id": 90, "material": "PE", "installation_year": 1999, "pressure_score": 0.796209633}, {"id": 91, "material": "cast_iron", "installation_year": 2012, "pressure_score": 0.785452264}, {"id": 92, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 0.725452264}, {"id": 93, "material": "steel", "installation_year": 2010, "pressure_score": 0.725452264}, {"id": 94, "material": "concrete", "installation_year": 2022, "pressure_score": 0.725452264}, {"id": 95, "material": "PVC", "installation_year": 2023, "pressure_score": 0.725452264}, {"id": 96, "material": "PE", "installation_year": 2023, "pressure_score": 0.649245632}, {"id": 97, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.619245632}, {"id": 98, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.589245632}, {"id": 99, "material": "steel", "installation_year": 2018, "pressure_score": 0.589245632}, {"id": 100, "material": "concrete", "installation_year": 2017, "pressure_score": 0.589245632}, {"id": 101, "material": "cast_iron", "installation_year": 2010, "pressure_score": 1.162786924}, {"id": 102, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 1.162786924}, {"id": 103, "material": "steel", "installation_year": 2022, "pressure_score": 1.146994562}, {"id": 104, "material": "concrete", "installation_year": 2023, "pressure_score": 1.116994562}, {"id": 105, "material": "PVC", "installation_year": 2022, "pressure_score": 1.106269549}, {"id": 106, "material": "PE", "installation_year": 2020, "pressure_score": 1.094515901}, {"id": 107, "material": "cast_iron", "installation_year": 2011, "pressure_score": 1.086994562}, {"id": 108, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 1.086994562}, {"id": 109, "material": "steel", "installation_year": 2004, "pressure_score": 1.086994562}, {"id": 110, "material": "concrete", "installation_year": 1999, "pressure_score": 1.076269549}, {"id": 111, "material": "cast_iron", "installation_year": 2012, "pressure_score": 1.074891466}, {"id": 112, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 1.074891466}, {"id": 113, "material": "steel", "installation_year": 2010, "pressure_score": 1.072786924}, {"id": 114, "material": "concrete", "installation_year": 2022, "pressure_score": 1.072786924}, {"id": 115, "material": "PVC", "installation_year": 2023, "pressure_score": 1.072786924}, {"id": 116, "material": "PE", "installation_year": 2023, "pressure_score": 1.063158031}, {"id": 117, "material": "cast_iron", "installation_year": 2022, "pressure_score": 1.051065059}, {"id": 118, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 1.050253372}, {"id": 119, "material": "steel", "installation_year": 2018, "pressure_score": 1.050253372}, {"id": 120, "material": "concrete", "installation_year": 2017, "pressure_score": 1.050253372}, {"id": 121, "material": "cast_iron", "installation_year": 2010, "pressure_score": 1.0498437}, {"id": 122, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 1.046269549}, {"id": 123, "material": "steel", "installation_year": 2022, "pressure_score": 1.046269549}, {"id": 124, "material": "concrete", "installation_year": 2023, "pressure_score": 1.046269549}, {"id": 125, "material": "PVC", "installation_year": 2022, "pressure_score": 1.038773901}, {"id": 126, "material": "PE", "installation_year": 2020, "pressure_score": 1.034515901}, {"id": 127, "material": "cast_iron", "installation_year": 2011, "pressure_score": 1.034515901}, {"id": 128, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 1.034515901}, {"id": 129, "material": "steel", "installation_year": 2004, "pressure_score": 1.034515901}, {"id": 130, "material": "concrete", "installation_year": 1999, "pressure_score": 1.033158031}, {"id": 131, "material": "cast_iron", "installation_year": 2012, "pressure_score": 1.0198437}, {"id": 132, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 1.008773901}, {"id": 133, "material": "steel", "installation_year": 2010, "pressure_score": 0.991065059}, {"id": 134, "material": "concrete", "installation_year": 2022, "pressure_score": 0.991065059}, {"id": 135, "material": "PVC", "installation_year": 2023, "pressure_score": 0.991065059}, {"id": 136, "material": "PE", "installation_year": 2023, "pressure_score": 0.991065059}, {"id": 137, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.990253372}, {"id": 138, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.987432502}, {"id": 139, "material": "steel", "installation_year": 2018, "pressure_score": 0.984891466}, {"id": 140, "material": "concrete", "installation_year": 2017, "pressure_score": 0.984891466}, {"id": 141, "material": "cast_iron", "installation_year": 2010, "pressure_score": 0.984891466}, {"id": 142, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 0.973158031}, {"id": 143, "material": "steel", "installation_year": 2022, "pressure_score": 0.973158031}, {"id": 144, "material": "concrete", "installation_year": 2023, "pressure_score": 0.973158031}, {"id": 145, "material": "PVC", "installation_year": 2022, "pressure_score": 0.960772651}, {"id": 146, "material": "PE", "installation_year": 2020, "pressure_score": 0.960772651}, {"id": 147, "material": "cast_iron", "installation_year": 2011, "pressure_score": 0.960253372}, {"id": 148, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 0.960253372}, {"id": 149, "material": "steel", "installation_year": 2004, "pressure_score": 0.960253372}, {"id": 150, "material": "concrete", "installation_year": 1999, "pressure_score": 0.960253372}, {"id": 151, "material": "cast_iron", "installation_year": 2012, "pressure_score": 0.960253372}, {"id": 152, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 0.960253372}, {"id": 153, "material": "steel", "installation_year": 2010, "pressure_score": 0.9598437}, {"id": 154, "material": "concrete", "installation_year": 2022, "pressure_score": 0.9598437}, {"id": 155, "material": "PVC", "installation_year": 2023, "pressure_score": 0.9598437}, {"id": 156, "material": "PE", "installation_year": 2023, "pressure_score": 0.957432502}, {"id": 157, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.956684241}, {"id": 158, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.948773901}, {"id": 159, "material": "steel", "installation_year": 2018, "pressure_score": 0.948773901}, {"id": 160, "material": "concrete", "installation_year": 2017, "pressure_score": 0.948773901}, {"id": 161, "material": "cast_iron", "installation_year": 2010, "pressure_score": 0.942455985}, {"id": 162, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 0.942455985}, {"id": 163, "material": "steel", "installation_year": 2022, "pressure_score": 0.92847699}, {"id": 164, "material": "concrete", "installation_year": 2023, "pressure_score": 0.918273896}, {"id": 165, "material": "PVC", "installation_year": 2022, "pressure_score": 0.900772651}, {"id": 166, "material": "PE", "installation_year": 2020, "pressure_score": 0.900772651}, {"id": 167, "material": "cast_iron", "installation_year": 2011, "pressure_score": 0.900772651}, {"id": 168, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 0.89847699}, {"id": 169, "material": "steel", "installation_year": 2004, "pressure_score": 0.897432502}, {"id": 170, "material": "concrete", "installation_year": 1999, "pressure_score": 0.897432502}, {"id": 171, "material": "cast_iron", "installation_year": 2012, "pressure_score": 0.897432502}, {"id": 172, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 0.896684241}, {"id": 173, "material": "steel", "installation_year": 2010, "pressure_score": 0.886209633}, {"id": 174, "material": "concrete", "installation_year": 2022, "pressure_score": 0.882455985}, {"id": 175, "material": "PVC", "installation_year": 2023, "pressure_score": 0.882455985}, {"id": 176, "material": "PE", "installation_year": 2023, "pressure_score": 0.882455985}, {"id": 177, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.866684241}, {"id": 178, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.866684241}, {"id": 179, "material": "steel", "installation_year": 2018, "pressure_score": 0.866684241}, {"id": 180, "material": "concrete", "installation_year": 2017, "pressure_score": 0.83847699}, {"id": 181, "material": "cast_iron", "installation_year": 2010, "pressure_score": 0.83847699}, {"id": 182, "material": "ductile_iron", "installation_year": 2013, "pressure_score": 0.83847699}, {"id": 183, "material": "steel", "installation_year": 2022, "pressure_score": 0.828273896}, {"id": 184, "material": "concrete", "installation_year": 2023, "pressure_score": 0.828273896}, {"id": 185, "material": "PVC", "installation_year": 2022, "pressure_score": 0.828273896}, {"id": 186, "material": "PE", "installation_year": 2020, "pressure_score": 0.828273896}, {"id": 187, "material": "cast_iron", "installation_year": 2011, "pressure_score": 0.796209633}, {"id": 188, "material": "ductile_iron", "installation_year": 2007, "pressure_score": 0.796209633}, {"id": 189, "material": "steel", "installation_year": 2004, "pressure_score": 0.796209633}, {"id": 190, "material": "concrete", "installation_year": 1999, "pressure_score": 0.796209633}, {"id": 191, "material": "cast_iron", "installation_year": 2012, "pressure_score": 0.785452264}, {"id": 192, "material": "ductile_iron", "installation_year": 2011, "pressure_score": 0.725452264}, {"id": 193, "material": "steel", "installation_year": 2010, "pressure_score": 0.725452264}, {"id": 194, "material": "concrete", "installation_year": 2022, "pressure_score": 0.725452264}, {"id": 195, "material": "PVC", "installation_year": 2023, "pressure_score": 0.725452264}, {"id": 196, "material": "PE", "installation_year": 2023, "pressure_score": 0.649245632}, {"id": 197, "material": "cast_iron", "installation_year": 2022, "pressure_score": 0.619245632}, {"id": 198, "material": "ductile_iron", "installation_year": 2016, "pressure_score": 0.589245632}, {"id": 199, "material": "steel", "installation_year": 2018, "pressure_score": 0.589245632}, {"id": 200, "material": "concrete", "installation_year": 2017, "pressure_score": 0.589245632}]
# 接口3示例：[{"time": 1, "pressure": 0.409934283}, {"time": 2, "pressure": 0.397234714}, {"time": 3, "pressure": 0.412953771}, {"time": 4, "pressure": 0.430460597}, {"time": 5, "pressure": 0.395316933}, {"time": 6, "pressure": 0.395317261}, {"time": 7, "pressure": 0.431584256}, {"time": 8, "pressure": 0.415348695}, {"time": 9, "pressure": 0.390610512}, {"time": 10, "pressure": 0.410851201}, {"time": 11, "pressure": 0.390731646}, {"time": 12, "pressure": 0.390685405}, {"time": 13, "pressure": 0.404839245}, {"time": 14, "pressure": 0.361734395}, {"time": 15, "pressure": 0.365501643}, {"time": 16, "pressure": 0.388754249}, {"time": 17, "pressure": 0.379743378}, {"time": 18, "pressure": 0.406284947}, {"time": 19, "pressure": 0.381839518}, {"time": 20, "pressure": 0.371753926}, {"time": 21, "pressure": 0.429312975}, {"time": 22, "pressure": 0.395484474}, {"time": 23, "pressure": 0.401350564}, {"time": 24, "pressure": 0.371505036}, {"time": 25, "pressure": 0.389112346}, {"time": 26, "pressure": 0.402218452}, {"time": 27, "pressure": 0.376980128}, {"time": 28, "pressure": 0.40751396}, {"time": 29, "pressure": 0.387987226}, {"time": 30, "pressure": 0.394166125}, {"time": 31, "pressure": 0.387965868}, {"time": 32, "pressure": 0.437045564}, {"time": 33, "pressure": 0.399730056}, {"time": 34, "pressure": 0.378845781}, {"time": 35, "pressure": 0.416450898}, {"time": 36, "pressure": 0.375583127}, {"time": 37, "pressure": 0.404177272}, {"time": 38, "pressure": 0.360806598}, {"time": 39, "pressure": 0.373436279}, {"time": 40, "pressure": 0.403937225}, {"time": 41, "pressure": 0.414769332}, {"time": 42, "pressure": 0.403427366}, {"time": 43, "pressure": 0.397687034}, {"time": 44, "pressure": 0.393977926}, {"time": 45, "pressure": 0.37042956}, {"time": 46, "pressure": 0.385603116}, {"time": 47, "pressure": 0.390787225}, {"time": 48, "pressure": 0.421142445}, {"time": 49, "pressure": 0.406872366}, {"time": 50, "pressure": 0.364739197}, {"time": 51, "pressure": 0.284537176}, {"time": 52, "pressure": 0.274608848}, {"time": 53, "pressure": 0.270523092}, {"time": 54, "pressure": 0.288563468}, {"time": 55, "pressure": 0.294433993}, {"time": 56, "pressure": 0.418625602}, {"time": 57, "pressure": 0.38321565}, {"time": 58, "pressure": 0.393815752}, {"time": 59, "pressure": 0.406625269}, {"time": 60, "pressure": 0.419510903}, {"time": 61, "pressure": 0.390416515}, {"time": 62, "pressure": 0.39628682}, {"time": 63, "pressure": 0.377873301}, {"time": 64, "pressure": 0.376075868}, {"time": 65, "pressure": 0.416250516}, {"time": 66, "pressure": 0.427124801}, {"time": 67, "pressure": 0.398559798}, {"time": 68, "pressure": 0.420070658}, {"time": 69, "pressure": 0.407232721}, {"time": 70, "pressure": 0.387097605}, {"time": 71, "pressure": 0.407227912}, {"time": 72, "pressure": 0.430760731}, {"time": 73, "pressure": 0.399283479}, {"time": 74, "pressure": 0.431292873}, {"time": 75, "pressure": 0.347605098}, {"time": 76, "pressure": 0.41643805}, {"time": 77, "pressure": 0.401740941}, {"time": 78, "pressure": 0.394019853}, {"time": 79, "pressure": 0.401835216}, {"time": 80, "pressure": 0.360248622}, {"time": 81, "pressure": 0.395606562}, {"time": 82, "pressure": 0.407142251}, {"time": 83, "pressure": 0.429557881}, {"time": 84, "pressure": 0.389634596}, {"time": 85, "pressure": 0.383830128}, {"time": 86, "pressure": 0.389964859}, {"time": 87, "pressure": 0.418308042}, {"time": 88, "pressure": 0.406575022}, {"time": 89, "pressure": 0.389404796}, {"time": 90, "pressure": 0.410265349}, {"time": 91, "pressure": 0.401941551}, {"time": 92, "pressure": 0.4193729}, {"time": 93, "pressure": 0.385958938}, {"time": 94, "pressure": 0.393446757}, {"time": 95, "pressure": 0.392157837}, {"time": 96, "pressure": 0.370729701}, {"time": 97, "pressure": 0.405922406}, {"time": 98, "pressure": 0.405221105}, {"time": 99, "pressure": 0.400102269}, {"time": 100, "pressure": 0.395308257}]
# 接口4示例1：[{"time": "2023-01-01 00:00:00", "pressure": 0.4099342830602246, "flow": 85.84629257949585, "demand": 0.0}, {"time": "2023-01-01 01:00:00", "pressure": 0.3972347139765763, "flow": 95.79354677234642, "demand": 0.0}, {"time": "2023-01-01 02:00:00", "pressure": 0.4129537707620139, "flow": 96.57285483473233, "demand": 0.0}, {"time": "2023-01-01 03:00:00", "pressure": 0.4304605971281605, "flow": 91.9772273077838, "demand": 0.0}, {"time": "2023-01-01 04:00:00", "pressure": 0.3953169325055333, "flow": 98.3871428833399, "demand": 0.0}, {"time": "2023-01-01 05:00:00", "pressure": 0.3953172608610164, "flow": 104.04050856814538, "demand": 0.0}, {"time": "2023-01-01 06:00:00", "pressure": 0.4315842563101478, "flow": 118.8618590121053, "demand": 0.0}, {"time": "2023-01-01 07:00:00", "pressure": 0.4153486945830582, "flow": 101.7457781283184, "demand": 0.0}, {"time": "2023-01-01 08:00:00", "pressure": 0.390610512281301, "flow": 102.57550390722764, "demand": 0.0}, {"time": "2023-01-01 09:00:00", "pressure": 0.4108512008717193, "flow": 99.25554084233832, "demand": 0.0}, {"time": "2023-01-01 10:00:00", "pressure": 0.3907316461437508, "flow": 80.81228784700959, "demand": 0.0}, {"time": "2023-01-01 11:00:00", "pressure": 0.3906854049285949, "flow": 99.73486124550784, "demand": 0.0}, {"time": "2023-01-01 12:00:00", "pressure": 0.4048392454313207, "flow": 100.60230209941028, "demand": 0.0}, {"time": "2023-01-01 13:00:00", "pressure": 0.3617343951068441, "flow": 124.63242112485288, "demand": 0.0}, {"time": "2023-01-01 14:00:00", "pressure": 0.3655016433497393, "flow": 98.07639035218878, "demand": 0.0}, {"time": "2023-01-01 15:00:00", "pressure": 0.3887542494151805, "flow": 103.01547342333612, "demand": 0.0}, {"time": "2023-01-01 16:00:00", "pressure": 0.3797433775933115, "flow": 99.65288230294756, "demand": 0.0}, {"time": "2023-01-01 17:00:00", "pressure": 0.4062849466519055, "flow": 88.31321962380468, "demand": 0.0}, {"time": "2023-01-01 18:00:00", "pressure": 0.3818395184895758, "flow": 111.4282281451502, "demand": 0.0}, {"time": "2023-01-01 19:00:00", "pressure": 0.3717539259732942, "flow": 107.51933032686776, "demand": 0.0}, {"time": "2023-01-01 20:00:00", "pressure": 0.4293129753784311, "flow": 107.91031947043048, "demand": 0.0}, {"time": "2023-01-01 21:00:00", "pressure": 0.3954844739902693, "flow": 90.9061254520526, "demand": 0.0}, {"time": "2023-01-01 22:00:00", "pressure": 0.4013505640937585, "flow": 114.027943109361, "demand": 0.0}, {"time": "2023-01-01 23:00:00", "pressure": 0.3715050362757309, "flow": 85.98148937207719, "demand": 0.0}, {"time": "2023-01-02 00:00:00", "pressure": 0.3891123455094963, "flow": 105.8685709380027, "demand": 0.0}, {"time": "2023-01-02 01:00:00", "pressure": 0.4022184517941973, "flow": 121.9045562580998, "demand": 0.0}, {"time": "2023-01-02 02:00:00", "pressure": 0.376980128451554, "flow": 90.09463674869312, "demand": 0.0}, {"time": "2023-01-02 03:00:00", "pressure": 0.4075139603669134, "flow": 94.33702270397228, "demand": 0.0}, {"time": "2023-01-02 04:00:00", "pressure": 0.3879872262016239, "flow": 100.9965136508764, "demand": 0.0}, {"time": "2023-01-02 05:00:00", "pressure": 0.3941661250041345, "flow": 94.965243458838, "demand": 0.0}, {"time": "2023-01-02 06:00:00", "pressure": 0.3879658677554121, "flow": 84.49336568933867, "demand": 0.0}, {"time": "2023-01-02 07:00:00", "pressure": 0.4370455636901788, "flow": 100.68562974806028, "demand": 0.0}, {"time": "2023-01-02 08:00:00", "pressure": 0.3997300555052413, "flow": 89.37696286273895, "demand": 0.0}, {"time": "2023-01-02 09:00:00", "pressure": 0.378845781420882, "flow": 104.73592430635182, "demand": 0.0}, {"time": "2023-01-02 10:00:00", "pressure": 0.4164508982420638, "flow": 90.80575765766196, "demand": 0.0}, {"time": "2023-01-02 11:00:00", "pressure": 0.3755831270005795, "flow": 115.4993440501754, "demand": 0.0}, {"time": "2023-01-02 12:00:00", "pressure": 0.4041772719000951, "flow": 92.16746707663764, "demand": 0.0}, {"time": "2023-01-02 13:00:00", "pressure": 0.3608065975224045, "flow": 96.77938483794324, "demand": 0.0}, {"time": "2023-01-02 14:00:00", "pressure": 0.3734362790220314, "flow": 108.1351721736967, "demand": 0.0}, {"time": "2023-01-02 15:00:00", "pressure": 0.4039372247173824, "flow": 87.69135683566044, "demand": 0.0}, {"time": "2023-01-02 16:00:00", "pressure": 0.4147693315999082, "flow": 102.2745993460413, "demand": 0.0}, {"time": "2023-01-02 17:00:00", "pressure": 0.4034273656237994, "flow": 113.07142754282428, "demand": 0.0}, {"time": "2023-01-02 18:00:00", "pressure": 0.3976870343522352, "flow": 83.92516765438772, "demand": 0.0}, {"time": "2023-01-02 19:00:00", "pressure": 0.3939779260882142, "flow": 101.84633858532304, "demand": 0.0}, {"time": "2023-01-02 20:00:00", "pressure": 0.3704295601926515, "flow": 102.59882794248423, "demand": 0.0}, {"time": "2023-01-02 21:00:00", "pressure": 0.3856031158321058, "flow": 107.81822871777312, "demand": 0.0}, {"time": "2023-01-02 22:00:00", "pressure": 0.3907872245808043, "flow": 87.63049289121918, "demand": 0.0}, {"time": "2023-01-02 23:00:00", "pressure": 0.4211424445243783, "flow": 86.79543386915724, "demand": 0.0}, {"time": "2023-01-03 00:00:00", "pressure": 0.4068723657913692, "flow": 105.21941565616898, "demand": 0.0}, {"time": "2023-01-03 01:00:00", "pressure": 0.3647391968927453, "flow": 102.96984673233186, "demand": 0.0}, {"time": "2023-01-03 02:00:00", "pressure": 0.2845371755715271, "flow": 133.2564070544964, "demand": 0.0}, {"time": "2023-01-03 03:00:00", "pressure": 0.2746088480741716, "flow": 134.5038267234607, "demand": 0.0}, {"time": "2023-01-03 04:00:00", "pressure": 0.2705230919957165, "flow": 121.15967861947962, "demand": 0.0}, {"time": "2023-01-03 05:00:00", "pressure": 0.2885634680437721, "flow": 133.01929806309306, "demand": 0.0}, {"time": "2023-01-03 06:00:00", "pressure": 0.2944339933149433, "flow": 133.80994215288283, "demand": 0.0}, {"time": "2023-01-03 07:00:00", "pressure": 0.418625602382324, "flow": 92.85648581973632, "demand": 0.0}, {"time": "2023-01-03 08:00:00", "pressure": 0.3832156495355472, "flow": 118.65774511144755, "demand": 0.0}, {"time": "2023-01-03 09:00:00", "pressure": 0.3938157524829757, "flow": 104.73832920911788, "demand": 0.0}, {"time": "2023-01-03 10:00:00", "pressure": 0.4066252686280713, "flow": 88.08696502797352, "demand": 0.0}, {"time": "2023-01-03 11:00:00", "pressure": 0.4195109025424472, "flow": 106.5655360863383, "demand": 0.0}, {"time": "2023-01-03 12:00:00", "pressure": 0.3904165152430942, "flow": 90.2531832977268, "demand": 0.0}, {"time": "2023-01-03 13:00:00", "pressure": 0.3962868204667237, "flow": 107.87084603742451, "demand": 0.0}, {"time": "2023-01-03 14:00:00", "pressure": 0.3778733005198794, "flow": 111.58595579007404, "demand": 0.0}, {"time": "2023-01-03 15:00:00", "pressure": 0.3760758675183866, "flow": 91.7931768164829, "demand": 0.0}, {"time": "2023-01-03 16:00:00", "pressure": 0.4162505164478839, "flow": 109.6337612924432, "demand": 0.0}, {"time": "2023-01-03 17:00:00", "pressure": 0.4271248005714165, "flow": 104.127809269365, "demand": 0.0}, {"time": "2023-01-03 18:00:00", "pressure": 0.3985597975683933, "flow": 108.2206015999449, "demand": 0.0}, {"time": "2023-01-03 19:00:00", "pressure": 0.4200706579578405, "flow": 118.96792982653947, "demand": 0.0}, {"time": "2023-01-03 20:00:00", "pressure": 0.4072327205009527, "flow": 97.5461188399713, "demand": 0.0}, {"time": "2023-01-03 21:00:00", "pressure": 0.3870976049078975, "flow": 92.4626383564251, "demand": 0.0}, {"time": "2023-01-03 22:00:00", "pressure": 0.4072279121101683, "flow": 91.10485570374476, "demand": 0.0}, {"time": "2023-01-03 23:00:00", "pressure": 0.4307607313293194, "flow": 91.84189715034562, "demand": 0.0}, {"time": "2023-01-04 00:00:00", "pressure": 0.399283479217801, "flow": 99.22898290585896, "demand": 0.0}, {"time": "2023-01-04 01:00:00", "pressure": 0.4312928731162802, "flow": 103.41151974816644, "demand": 0.0}, {"time": "2023-01-04 02:00:00", "pressure": 0.3476050979182051, "flow": 102.7669079933002, "demand": 0.0}, {"time": "2023-01-04 03:00:00", "pressure": 0.4164380500875045, "flow": 108.27183249036024, "demand": 0.0}, {"time": "2023-01-04 04:00:00", "pressure": 0.4017409413647634, "flow": 100.13001891877909, "demand": 0.0}, {"time": "2023-01-04 05:00:00", "pressure": 0.3940198529906826, "flow": 114.53534077157316, "demand": 0.0}, {"time": "2023-01-04 06:00:00", "pressure": 0.40183521553071, "flow": 97.35343166762044, "demand": 0.0}, {"time": "2023-01-04 07:00:00", "pressure": 0.3602486217079821, "flow": 127.2016916658962, "demand": 0.0}, {"time": "2023-01-04 08:00:00", "pressure": 0.3956065622432498, "flow": 106.25667347765008, "demand": 0.0}, {"time": "2023-01-04 09:00:00", "pressure": 0.4071422514302349, "flow": 91.42842443583716, "demand": 0.0}, {"time": "2023-01-04 10:00:00", "pressure": 0.4295578808948303, "flow": 89.29107501938887, "demand": 0.0}, {"time": "2023-01-04 11:00:00", "pressure": 0.389634595634527, "flow": 104.82472415243186, "demand": 0.0}, {"time": "2023-01-04 12:00:00", "pressure": 0.3838301279421363, "flow": 97.7653721467415, "demand": 0.0}, {"time": "2023-01-04 13:00:00", "pressure": 0.3899648591283093, "flow": 107.14000494092092, "demand": 0.0}, {"time": "2023-01-04 14:00:00", "pressure": 0.4183080423540415, "flow": 104.73237624573544, "demand": 0.0}, {"time": "2023-01-04 15:00:00", "pressure": 0.4065750221931937, "flow": 99.27171087343127, "demand": 0.0}, {"time": "2023-01-04 16:00:00", "pressure": 0.3894047959246592, "flow": 91.53206281931595, "demand": 0.0}, {"time": "2023-01-04 17:00:00", "pressure": 0.4102653486622671, "flow": 84.85152775314135, "demand": 0.0}, {"time": "2023-01-04 18:00:00", "pressure": 0.4019415509869608, "flow": 95.5348504793298, "demand": 0.0}, {"time": "2023-01-04 19:00:00", "pressure": 0.4193728998106578, "flow": 108.56398794323472, "demand": 0.0}, {"time": "2023-01-04 20:00:00", "pressure": 0.3859589381224529, "flow": 102.14093744130204, "demand": 0.0}, {"time": "2023-01-04 21:00:00", "pressure": 0.3934467570680446, "flow": 87.54261221288012, "demand": 0.0}, {"time": "2023-01-04 22:00:00", "pressure": 0.3921578369373569, "flow": 101.73180925851182, "demand": 0.0}, {"time": "2023-01-04 23:00:00", "pressure": 0.3707297010373576, "flow": 103.85317379728836, "demand": 0.0}, {"time": "2023-01-05 00:00:00", "pressure": 0.4059224055412915, "flow": 91.16142563798869, "demand": 0.0}, {"time": "2023-01-05 01:00:00", "pressure": 0.4052211054435978, "flow": 101.53725105945529, "demand": 0.0}, {"time": "2023-01-05 02:00:00", "pressure": 0.4001022691328492, "flow": 100.58208718446, "demand": 0.0}, {"time": "2023-01-05 03:00:00", "pressure": 0.3953082573324971, "flow": 88.57029702169376, "demand": 0.0}]
# 接口4示例2：[{"time": "2023-01-01 00:00:00", "pressure": 0.4099342830602246, "flow": 85.84629257949585, "demand": 82.86229888278626}, {"time": "2023-01-01 01:00:00", "pressure": 0.3972347139765763, "flow": 95.79354677234642, "demand": 84.48627621094587}, {"time": "2023-01-01 02:00:00", "pressure": 0.4129537707620139, "flow": 96.57285483473233, "demand": 88.66440994540221}, {"time": "2023-01-01 03:00:00", "pressure": 0.4304605971281605, "flow": 91.9772273077838, "demand": 88.43041641627923}, {"time": "2023-01-01 04:00:00", "pressure": 0.3953169325055333, "flow": 98.3871428833399, "demand": 68.97864505634327}, {"time": "2023-01-01 05:00:00", "pressure": 0.3953172608610164, "flow": 104.04050856814538, "demand": 72.49739968067902}, {"time": "2023-01-01 06:00:00", "pressure": 0.4315842563101478, "flow": 118.8618590121053, "demand": 84.12028213766928}, {"time": "2023-01-01 07:00:00", "pressure": 0.4153486945830582, "flow": 101.7457781283184, "demand": 84.11028760729766}, {"time": "2023-01-01 08:00:00", "pressure": 0.390610512281301, "flow": 102.57550390722764, "demand": 84.12038149044838}, {"time": "2023-01-01 09:00:00", "pressure": 0.4108512008717193, "flow": 99.25554084233832, "demand": 110.82185192523777}, {"time": "2023-01-01 10:00:00", "pressure": 0.3907316461437508, "flow": 80.81228784700959, "demand": 84.56712408554533}, {"time": "2023-01-01 11:00:00", "pressure": 0.3906854049285949, "flow": 99.73486124550784, "demand": 89.08452512144478}, {"time": "2023-01-01 12:00:00", "pressure": 0.4048392454313207, "flow": 100.60230209941028, "demand": 87.63201410794562}, {"time": "2023-01-01 13:00:00", "pressure": 0.3617343951068441, "flow": 124.63242112485288, "demand": 85.21113001044638}, {"time": "2023-01-01 14:00:00", "pressure": 0.3655016433497393, "flow": 98.07639035218878, "demand": 77.47784604287723}, {"time": "2023-01-01 15:00:00", "pressure": 0.3887542494151805, "flow": 103.01547342333612, "demand": 86.07175376394613}, {"time": "2023-01-01 16:00:00", "pressure": 0.3797433775933115, "flow": 99.65288230294756, "demand": 73.81739828369942}, {"time": "2023-01-01 17:00:00", "pressure": 0.4062849466519055, "flow": 88.31321962380468, "demand": 78.10545114607993}, {"time": "2023-01-01 18:00:00", "pressure": 0.3818395184895758, "flow": 111.4282281451502, "demand": 76.11709161736717}, {"time": "2023-01-01 19:00:00", "pressure": 0.3717539259732942, "flow": 107.51933032686776, "demand": 80.65499311509058}, {"time": "2023-01-01 20:00:00", "pressure": 0.4293129753784311, "flow": 107.91031947043048, "demand": 98.51726853338806}, {"time": "2023-01-01 21:00:00", "pressure": 0.3954844739902693, "flow": 90.9061254520526, "demand": 65.06187845926601}, {"time": "2023-01-01 22:00:00", "pressure": 0.4013505640937585, "flow": 114.027943109361, "demand": 85.4900815229961}, {"time": "2023-01-01 23:00:00", "pressure": 0.3715050362757309, "flow": 85.98148937207719, "demand": 67.09827303048279}, {"time": "2023-01-02 00:00:00", "pressure": 0.3891123455094963, "flow": 105.8685709380027, "demand": 76.22454507368454}, {"time": "2023-01-02 01:00:00", "pressure": 0.4022184517941973, "flow": 121.9045562580998, "demand": 88.71160477573893}, {"time": "2023-01-02 02:00:00", "pressure": 0.376980128451554, "flow": 90.09463674869312, "demand": 80.5142401527637}, {"time": "2023-01-02 03:00:00", "pressure": 0.4075139603669134, "flow": 94.33702270397228, "demand": 71.37804177656555}, {"time": "2023-01-02 04:00:00", "pressure": 0.3879872262016239, "flow": 100.9965136508764, "demand": 74.27757032592025}, {"time": "2023-01-02 05:00:00", "pressure": 0.3941661250041345, "flow": 94.965243458838, "demand": 85.4367819914774}, {"time": "2023-01-02 06:00:00", "pressure": 0.3879658677554121, "flow": 84.49336568933867, "demand": 74.1570669462629}, {"time": "2023-01-02 07:00:00", "pressure": 0.4370455636901788, "flow": 100.68562974806028, "demand": 81.7316687166558}, {"time": "2023-01-02 08:00:00", "pressure": 0.3997300555052413, "flow": 89.37696286273895, "demand": 80.3645747192305}, {"time": "2023-01-02 09:00:00", "pressure": 0.378845781420882, "flow": 104.73592430635182, "demand": 74.78719721915347}, {"time": "2023-01-02 10:00:00", "pressure": 0.4164508982420638, "flow": 90.80575765766196, "demand": 97.1515527146026}, {"time": "2023-01-02 11:00:00", "pressure": 0.3755831270005795, "flow": 115.4993440501754, "demand": 85.07135217854409}, {"time": "2023-01-02 12:00:00", "pressure": 0.4041772719000951, "flow": 92.16746707663764, "demand": 63.798859306739146}, {"time": "2023-01-02 13:00:00", "pressure": 0.3608065975224045, "flow": 96.77938483794324, "demand": 81.49163451815542}, {"time": "2023-01-02 14:00:00", "pressure": 0.3734362790220314, "flow": 108.1351721736967, "demand": 74.70570828185289}, {"time": "2023-01-02 15:00:00", "pressure": 0.4039372247173824, "flow": 87.69135683566044, "demand": 86.81946667836979}, {"time": "2023-01-02 16:00:00", "pressure": 0.4147693315999082, "flow": 102.2745993460413, "demand": 73.65983409253839}, {"time": "2023-01-02 17:00:00", "pressure": 0.4034273656237994, "flow": 113.07142754282428, "demand": 79.0821084682648}, {"time": "2023-01-02 18:00:00", "pressure": 0.3976870343522352, "flow": 83.92516765438772, "demand": 84.03989823184365}, {"time": "2023-01-02 19:00:00", "pressure": 0.3939779260882142, "flow": 101.84633858532304, "demand": 86.92604155336097}, {"time": "2023-01-02 20:00:00", "pressure": 0.3704295601926515, "flow": 102.59882794248423, "demand": 70.3976287435538}, {"time": "2023-01-02 21:00:00", "pressure": 0.3856031158321058, "flow": 107.81822871777312, "demand": 77.32399011327242}, {"time": "2023-01-02 22:00:00", "pressure": 0.3907872245808043, "flow": 87.63049289121918, "demand": 76.20043751071235}, {"time": "2023-01-02 23:00:00", "pressure": 0.4211424445243783, "flow": 86.79543386915724, "demand": 74.7733661394103}, {"time": "2023-01-03 00:00:00", "pressure": 0.4068723657913692, "flow": 105.21941565616898, "demand": 94.12363392224876}, {"time": "2023-01-03 01:00:00", "pressure": 0.3647391968927453, "flow": 102.96984673233186, "demand": 83.23985368768764}, {"time": "2023-01-03 02:00:00", "pressure": 0.2845371755715271, "flow": 133.2564070544964, "demand": 69.91292836531964}, {"time": "2023-01-03 03:00:00", "pressure": 0.2746088480741716, "flow": 134.5038267234607, "demand": 87.34289557643821}, {"time": "2023-01-03 04:00:00", "pressure": 0.2705230919957165, "flow": 121.15967861947962, "demand": 96.97724957610106}, {"time": "2023-01-03 05:00:00", "pressure": 0.2885634680437721, "flow": 133.01929806309306, "demand": 88.25972208440918}, {"time": "2023-01-03 06:00:00", "pressure": 0.2944339933149433, "flow": 133.80994215288283, "demand": 67.8450402723679}, {"time": "2023-01-03 07:00:00", "pressure": 0.418625602382324, "flow": 92.85648581973632, "demand": 76.12612741707}, {"time": "2023-01-03 08:00:00", "pressure": 0.3832156495355472, "flow": 118.65774511144755, "demand": 90.13528919349298}, {"time": "2023-01-03 09:00:00", "pressure": 0.3938157524829757, "flow": 104.73832920911788, "demand": 74.33864427504976}, {"time": "2023-01-03 10:00:00", "pressure": 0.4066252686280713, "flow": 88.08696502797352, "demand": 83.55055542516983}, {"time": "2023-01-03 11:00:00", "pressure": 0.4195109025424472, "flow": 106.5655360863383, "demand": 86.19707242743469}, {"time": "2023-01-03 12:00:00", "pressure": 0.3904165152430942, "flow": 90.2531832977268, "demand": 72.58455622737533}, {"time": "2023-01-03 13:00:00", "pressure": 0.3962868204667237, "flow": 107.87084603742451, "demand": 79.5237971515056}, {"time": "2023-01-03 14:00:00", "pressure": 0.3778733005198794, "flow": 111.58595579007404, "demand": 54.06986127944742}, {"time": "2023-01-03 15:00:00", "pressure": 0.3760758675183866, "flow": 91.7931768164829, "demand": 71.80489886932568}, {"time": "2023-01-03 16:00:00", "pressure": 0.4162505164478839, "flow": 109.6337612924432, "demand": 77.97945478885472}, {"time": "2023-01-03 17:00:00", "pressure": 0.4271248005714165, "flow": 104.127809269365, "demand": 70.01773454428121}, {"time": "2023-01-03 18:00:00", "pressure": 0.3985597975683933, "flow": 108.2206015999449, "demand": 93.05929043145308}, {"time": "2023-01-03 19:00:00", "pressure": 0.4200706579578405, "flow": 118.96792982653947, "demand": 68.55886897631494}, {"time": "2023-01-03 20:00:00", "pressure": 0.4072327205009527, "flow": 97.5461188399713, "demand": 76.47964410642413}, {"time": "2023-01-03 21:00:00", "pressure": 0.3870976049078975, "flow": 92.4626383564251, "demand": 81.04592461828874}, {"time": "2023-01-03 22:00:00", "pressure": 0.4072279121101683, "flow": 91.10485570374476, "demand": 91.53018631252893}, {"time": "2023-01-03 23:00:00", "pressure": 0.4307607313293194, "flow": 91.84189715034562, "demand": 68.51310279056449}, {"time": "2023-01-04 00:00:00", "pressure": 0.399283479217801, "flow": 99.22898290585896, "demand": 89.30531001723968}, {"time": "2023-01-04 01:00:00", "pressure": 0.4312928731162802, "flow": 103.41151974816644, "demand": 80.0818644881567}, {"time": "2023-01-04 02:00:00", "pressure": 0.3476050979182051, "flow": 102.7669079933002, "demand": 72.14793079161639}, {"time": "2023-01-04 03:00:00", "pressure": 0.4164380500875045, "flow": 108.27183249036024, "demand": 83.69682779410617}, {"time": "2023-01-04 04:00:00", "pressure": 0.4017409413647634, "flow": 100.13001891877909, "demand": 81.59247756458777}, {"time": "2023-01-04 05:00:00", "pressure": 0.3940198529906826, "flow": 114.53534077157316, "demand": 75.19826498272964}, {"time": "2023-01-04 06:00:00", "pressure": 0.40183521553071, "flow": 97.35343166762044, "demand": 80.55841667992016}, {"time": "2023-01-04 07:00:00", "pressure": 0.3602486217079821, "flow": 127.2016916658962, "demand": 76.91749122510592}, {"time": "2023-01-04 08:00:00", "pressure": 0.3956065622432498, "flow": 106.25667347765008, "demand": 80.90813876200998}, {"time": "2023-01-04 09:00:00", "pressure": 0.4071422514302349, "flow": 91.42842443583716, "demand": 85.29704539616837}, {"time": "2023-01-04 10:00:00", "pressure": 0.4295578808948303, "flow": 89.29107501938887, "demand": 92.68813452916282}, {"time": "2023-01-04 11:00:00", "pressure": 0.389634595634527, "flow": 104.82472415243186, "demand": 70.0974760093852}, {"time": "2023-01-04 12:00:00", "pressure": 0.3838301279421363, "flow": 97.7653721467415, "demand": 97.06426699725012}, {"time": "2023-01-04 13:00:00", "pressure": 0.3899648591283093, "flow": 107.14000494092092, "demand": 64.38329760381998}, {"time": "2023-01-04 14:00:00", "pressure": 0.4183080423540415, "flow": 104.73237624573544, "demand": 78.78571923971533}, {"time": "2023-01-04 15:00:00", "pressure": 0.4065750221931937, "flow": 99.27171087343127, "demand": 84.70653765187662}, {"time": "2023-01-04 16:00:00", "pressure": 0.3894047959246592, "flow": 91.53206281931595, "demand": 82.24793494188026}, {"time": "2023-01-04 17:00:00", "pressure": 0.4102653486622671, "flow": 84.85152775314135, "demand": 75.01840384143524}, {"time": "2023-01-04 18:00:00", "pressure": 0.4019415509869608, "flow": 95.5348504793298, "demand": 78.3350219971418}, {"time": "2023-01-04 19:00:00", "pressure": 0.4193728998106578, "flow": 108.56398794323472, "demand": 76.05599252272934}, {"time": "2023-01-04 20:00:00", "pressure": 0.3859589381224529, "flow": 102.14093744130204, "demand": 75.2850819444463}, {"time": "2023-01-04 21:00:00", "pressure": 0.3934467570680446, "flow": 87.54261221288012, "demand": 86.7968167761682}, {"time": "2023-01-04 22:00:00", "pressure": 0.3921578369373569, "flow": 101.73180925851182, "demand": 82.85612388772037}, {"time": "2023-01-04 23:00:00", "pressure": 0.3707297010373576, "flow": 103.85317379728836, "demand": 74.45672323791477}, {"time": "2023-01-05 00:00:00", "pressure": 0.4059224055412915, "flow": 91.16142563798869, "demand": 87.19679900346601}, {"time": "2023-01-05 01:00:00", "pressure": 0.4052211054435978, "flow": 101.53725105945529, "demand": 82.45839616701288}, {"time": "2023-01-05 02:00:00", "pressure": 0.4001022691328492, "flow": 100.58208718446, "demand": 86.50289695071169}, {"time": "2023-01-05 03:00:00", "pressure": 0.3953082573324971, "flow": 88.57029702169376, "demand": 85.0370307353889}]
# 接口5示例：[{"time": "2023/1/1 0:00", "pressure": 0.409934283}, {"time": "2023/1/1 1:00", "pressure": 0.397234714}, {"time": "2023/1/1 2:00", "pressure": 0.412953771}, {"time": "2023/1/1 3:00", "pressure": 0.430460597}, {"time": "2023/1/1 4:00", "pressure": 0.395316933}, {"time": "2023/1/1 5:00", "pressure": 0.395317261}, {"time": "2023/1/1 6:00", "pressure": 0.431584256}, {"time": "2023/1/1 7:00", "pressure": 0.415348695}, {"time": "2023/1/1 8:00", "pressure": 0.390610512}, {"time": "2023/1/1 9:00", "pressure": 0.410851201}, {"time": "2023/1/1 10:00", "pressure": 0.390731646}, {"time": "2023/1/1 11:00", "pressure": 0.390685405}, {"time": "2023/1/1 12:00", "pressure": 0.404839245}, {"time": "2023/1/1 13:00", "pressure": 0.361734395}, {"time": "2023/1/1 14:00", "pressure": 0.365501643}, {"time": "2023/1/1 15:00", "pressure": 0.388754249}, {"time": "2023/1/1 16:00", "pressure": 0.379743378}, {"time": "2023/1/1 17:00", "pressure": 0.406284947}, {"time": "2023/1/1 18:00", "pressure": 0.381839518}, {"time": "2023/1/1 19:00", "pressure": 0.371753926}, {"time": "2023/1/1 20:00", "pressure": 0.429312975}, {"time": "2023/1/1 21:00", "pressure": 0.395484474}, {"time": "2023/1/1 22:00", "pressure": 0.401350564}, {"time": "2023/1/1 23:00", "pressure": 0.371505036}, {"time": "2023/1/2 0:00", "pressure": 0.389112346}, {"time": "2023/1/2 1:00", "pressure": 0.402218452}, {"time": "2023/1/2 2:00", "pressure": 0.376980128}, {"time": "2023/1/2 3:00", "pressure": 0.40751396}, {"time": "2023/1/2 4:00", "pressure": 0.387987226}, {"time": "2023/1/2 5:00", "pressure": 0.394166125}, {"time": "2023/1/2 6:00", "pressure": 0.387965868}, {"time": "2023/1/2 7:00", "pressure": 0.437045564}, {"time": "2023/1/2 8:00", "pressure": 0.399730056}, {"time": "2023/1/2 9:00", "pressure": 0.378845781}, {"time": "2023/1/2 10:00", "pressure": 0.416450898}, {"time": "2023/1/2 11:00", "pressure": 0.375583127}, {"time": "2023/1/2 12:00", "pressure": 0.404177272}, {"time": "2023/1/2 13:00", "pressure": 0.360806598}, {"time": "2023/1/2 14:00", "pressure": 0.373436279}, {"time": "2023/1/2 15:00", "pressure": 0.403937225}, {"time": "2023/1/2 16:00", "pressure": 0.414769332}, {"time": "2023/1/2 17:00", "pressure": 0.403427366}, {"time": "2023/1/2 18:00", "pressure": 0.397687034}, {"time": "2023/1/2 19:00", "pressure": 0.393977926}, {"time": "2023/1/2 20:00", "pressure": 0.37042956}, {"time": "2023/1/2 21:00", "pressure": 0.385603116}, {"time": "2023/1/2 22:00", "pressure": 0.390787225}, {"time": "2023/1/2 23:00", "pressure": 0.421142445}, {"time": "2023/1/3 0:00", "pressure": 0.406872366}, {"time": "2023/1/3 1:00", "pressure": 0.364739197}, {"time": "2023/1/3 2:00", "pressure": 0.284537176}, {"time": "2023/1/3 3:00", "pressure": 0.274608848}, {"time": "2023/1/3 4:00", "pressure": 0.270523092}, {"time": "2023/1/3 5:00", "pressure": 0.288563468}, {"time": "2023/1/3 6:00", "pressure": 0.294433993}, {"time": "2023/1/3 7:00", "pressure": 0.418625602}, {"time": "2023/1/3 8:00", "pressure": 0.38321565}, {"time": "2023/1/3 9:00", "pressure": 0.393815752}, {"time": "2023/1/3 10:00", "pressure": 0.406625269}, {"time": "2023/1/3 11:00", "pressure": 0.419510903}, {"time": "2023/1/3 12:00", "pressure": 0.390416515}, {"time": "2023/1/3 13:00", "pressure": 0.39628682}, {"time": "2023/1/3 14:00", "pressure": 0.377873301}, {"time": "2023/1/3 15:00", "pressure": 0.376075868}, {"time": "2023/1/3 16:00", "pressure": 0.416250516}, {"time": "2023/1/3 17:00", "pressure": 0.427124801}, {"time": "2023/1/3 18:00", "pressure": 0.398559798}, {"time": "2023/1/3 19:00", "pressure": 0.420070658}, {"time": "2023/1/3 20:00", "pressure": 0.407232721}, {"time": "2023/1/3 21:00", "pressure": 0.387097605}, {"time": "2023/1/3 22:00", "pressure": 0.407227912}, {"time": "2023/1/3 23:00", "pressure": 0.430760731}, {"time": "2023/1/4 0:00", "pressure": 0.399283479}, {"time": "2023/1/4 1:00", "pressure": 0.431292873}, {"time": "2023/1/4 2:00", "pressure": 0.347605098}, {"time": "2023/1/4 3:00", "pressure": 0.41643805}, {"time": "2023/1/4 4:00", "pressure": 0.401740941}, {"time": "2023/1/4 5:00", "pressure": 0.394019853}, {"time": "2023/1/4 6:00", "pressure": 0.401835216}, {"time": "2023/1/4 7:00", "pressure": 0.360248622}, {"time": "2023/1/4 8:00", "pressure": 0.395606562}, {"time": "2023/1/4 9:00", "pressure": 0.407142251}, {"time": "2023/1/4 10:00", "pressure": 0.429557881}, {"time": "2023/1/4 11:00", "pressure": 0.389634596}, {"time": "2023/1/4 12:00", "pressure": 0.383830128}, {"time": "2023/1/4 13:00", "pressure": 0.389964859}, {"time": "2023/1/4 14:00", "pressure": 0.418308042}, {"time": "2023/1/4 15:00", "pressure": 0.406575022}, {"time": "2023/1/4 16:00", "pressure": 0.389404796}, {"time": "2023/1/4 17:00", "pressure": 0.410265349}, {"time": "2023/1/4 18:00", "pressure": 0.401941551}, {"time": "2023/1/4 19:00", "pressure": 0.4193729}, {"time": "2023/1/4 20:00", "pressure": 0.385958938}, {"time": "2023/1/4 21:00", "pressure": 0.393446757}, {"time": "2023/1/4 22:00", "pressure": 0.392157837}, {"time": "2023/1/4 23:00", "pressure": 0.370729701}, {"time": "2023/1/5 0:00", "pressure": 0.405922406}, {"time": "2023/1/5 1:00", "pressure": 0.405221105}, {"time": "2023/1/5 2:00", "pressure": 0.400102269}, {"time": "2023/1/5 3:00", "pressure": 0.395308257}]